From: | Jesper Svennevid |
Date: | 23 Aug 99 at 10:08:50 |
Subject: | RE: Drawing in a window |
From: "Jesper Svennevid" <jesper@fxrealm.com>
> From: Fritsch Alexander <Alexander.Fritsch@icn.siemens.de>
>
> But if I were stopping to call Draw() I think my window
> contents would be damaged if I move other windows over my
> oscilloscope. What is the right way to prevent my window
> from beeing damaged? (But I need to be as fast as possible)
There are two solutions to this: You could set the window-
refresh into smart-refresh, and handle the damage-messages
that your window will send to you, allowing you to use your
own code to patch up the "holes", or you could set it to
simple-refresh and then Intuition will handle all that
refreshing.
> I want to have a "Cursor" in my oscilloscope. That means I
> would like to have one or two yellow lines on top of my
> display. I would like to be able to move these cursors with
> the mouse. But I dont want to add standard propotional
> gadgets to the window, I want to move the "Cursors" directly
> with the mouse. What is the right way here? Should I look
> after mouse events in the windows event loop and if there
> is a "mouse down" then look whether the mouse is near my
> cursor? Or is there a better (not so self made) solution?
> Does somebody have an example for me? (Open a window and
> move a line with the mouse)
Yes, if you're to do a few 'gizmos' in your window, listening
to IDCMP_MOUSEMOVE & IDCMP_MOUSEBUTTONS would be
appropriate. When you press the mouse button down you should
check which gizmo-zone you've clicked in and keep that 'id'
until you release the mouse-button, and assign any new mouse-
coordinate that's appropriate while you drag the mouse. This
will allow you not to loose focus of the gizmo itself,
as you would if you checked the gizmos at each coordinate-
change.
> Finally I want to make my window somewhat nicer. For
> example I could add a bevel box. I found the function
> DrawBevelBox(), but this is also just a drawing function,
> so have the same problem again, How do I prevent my bevel
> box from being damaged if another window is moved over
> my window?
This issue should apply to what I said before :)
> Programming the amiga would be much simpler I we had much
> more books or examples, the RKRMs or the autodocs are a
> good reference if now what you are looking for, but they
> are insufficient if you need an entry in the world of
> Amiga-specific programming :-(
Bah, I've coped with only includes, autodocs & a few example-
sources all this time, so it isn't THAT hard :) I've never
felt the need for reading the RKRMs :)